const koa = require("koa");
const app = new koa;
// 跨域中间件
const cors = require("koa-cors");
// 路由中间件引入
const mainRouter = require('./routers/index');
const searchRouter = require('./routers/search');
const videosRouter = require('./routers/videos');
const rankingRouter = require('./routers/ranking');
const transferRouter = require('./routers/transfer');

const router = require('koa-router')()

// 挂载中间件
app.use(cors());
app.use(mainRouter);
router.use('/search', searchRouter)
router.use('/videos', videosRouter)
router.use('/ranking', rankingRouter)
router.use('/transfer', transferRouter)
app.use(router.routes());

app.listen(3011);